<?php

use Phinx\Migration\AbstractMigration;

class AddColumnStorageIdAndStorageTypeInVersionTable extends AbstractMigration
{
    public function up()
    {
        $this->table("version")
            ->addColumn("storage_type", "enum", [
                'values' => 'bd_pan',
                'default' => null,
                'null' => true,
                'comment' => '存储类型',
            ])
            ->addColumn('storage_id', 'integer', [
                'limit' => 11,
                'signed' => false,
                'null' => false,
                'default' => 0,
                'comment' => '存储id'
            ])
            ->save();
    }

    public function down()
    {
        $this->table("version")->removeColumn('storage_type')->removeColumn('storage_id')->save();
    }
}
